home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QuickTime - The Beta Release
/
QuickTime - The Beta Release.iso
/
Programming Stuff
/
Interfaces
/
Oldstyle C Interfaces
/
Components.h
< prev
next >
Wrap
Text File
|
1991-09-06
|
8KB
|
210 lines
/* Component Manager.h
Interface to the Movies Component Manager
by Jim Batson, Bruce Leak, David Van Brink
Copyright 1990 Apple Computer, Inc. All rights reserved.
*/
#ifndef _Components_
#define _Components_
#include <Memory.h>
#ifndef kSmallestArray
#define kSmallestArray 1
#endif
#define gestaltComponentMgr 'cpnt'
typedef struct
{
unsigned long componentType; /* A unique 4-byte code indentifying the command set */
unsigned long componentSubType; /* Particular flavor of this instance */
unsigned long componentManufacturer; /* Vendor indentification */
unsigned long componentFlags; /* 8 each for Component,Type,SubType,Manuf/revision */
unsigned long componentFlagsMask; /* Mask for specifying which flags to consider in search, zero during registration */
} ComponentDescription;
typedef struct
{
unsigned long type; /* 4-byte code */
short id; /* */
} ResourceSpec;
typedef struct
{
ComponentDescription td; /* Registration parameters */
ResourceSpec component; /* resource where Component code is found */
ResourceSpec componentName; /* name string resource */
ResourceSpec componentInfo; /* info string resource */
ResourceSpec componentIcon; /* icon resource */
} ComponentResource;
#ifndef _PrivateThingManager_
typedef struct privateComponentRecord *Component;
typedef struct privateComponentInstanceRecord *ComponentInstance;
#endif _PrivateThingManager_
/* Structure received by Component: */
typedef struct
{
unsigned char flags; /* call modifiers: sync/async, deferred, immed, etc */
unsigned char paramSize; /* size in bytes of actual parameters passed to this call */
short what; /* routine selector, negative for Component management calls */
long params[kSmallestArray]; /* actual parameters for the indicated routine */
} ComponentParameters;
typedef long ComponentResult;
#if THINK_C == 1
typedef ComponentResult (*ComponentRoutine)
(ComponentParameters *tp, Handle componentStorage );
typedef ComponentResult (*ComponentFunction)();
#else
typedef pascal ComponentResult (*ComponentRoutine)
(ComponentParameters *tp, Handle componentStorage );
typedef pascal ComponentResult (*ComponentFunction)();
#endif
#define ComponentCallNow( callNumber, paramSize ) \
{0x2f3c,paramSize,callNumber,0x7000,0xA82A}
/********************************************************
* *
* APPLICATION LEVEL CALLS *
* *
********************************************************/
/********************************************************
* Component Database Add, Delete, and Query Routines
********************************************************/
pascal Component RegisterComponent(ComponentDescription *td, ComponentRoutine componentEntryPoint, short global, Handle componentName, Handle componentInfo, Handle componentIcon)
= {0x7001,0xa82a};
pascal Component RegisterComponentResource(ComponentResource **tr, short global)
= {0x7012,0xa82a};
pascal OSErr UnregisterComponent(Component aComponent)
= {0x7002,0xa82a};
pascal Component FindNextComponent(Component aComponent, ComponentDescription *looking)
= {0x7004,0xa82a};
pascal long CountComponents(ComponentDescription *looking)
= {0x7003,0xa82a};
pascal OSErr GetComponentInfo(Component aComponent, ComponentDescription *td, Handle componentName, Handle componentInfo, Handle componentIcon)
= {0x7005,0xa82a};
pascal long GetComponentListModSeed( )
= {0x7006,0xa82a};
/********************************************************
* Component Instance Allocation and dispatch routines
********************************************************/
pascal ComponentInstance OpenComponent(Component aComponent)
= {0x7007,0xa82a};
pascal OSErr CloseComponent(ComponentInstance aComponentInstance)
= {0x7008,0xa82a};
pascal OSErr GetComponentInstanceError(ComponentInstance aComponentInstance)
= {0x700a,0xa82a};
/* direct calls to the Components */
pascal long ComponentFunctionImplemented(ComponentInstance ti, short ftnNumber) = {0x2f3c,2,0xfffd,0x7000,0xa82a};
pascal long GetComponentVersion(ComponentInstance ti) = {0x2f3c,0,0xfffc,0x7000,0xa82a};
/********************************************************
* *
* CALLS MADE BY ComponentS *
* *
********************************************************/
/********************************************************
* Required Component routines
********************************************************/
#define kComponentOpenSelect -1 /* ComponentInstance for this open */
#define kComponentCloseSelect -2 /* ComponentInstance for this close */
#define kComponentCanDoSelect -3 /* selector # being queried */
#define kComponentVersionSelect -4 /* no params */
#define kComponentRegisterSelect -5 /* no params */
#define kComponentTargetSelect -6 /* ComponentInstance for top of call chain */
/********************************************************
* Component Management routines
********************************************************/
pascal void SetComponentInstanceError(ComponentInstance aComponentInstance, OSErr theError)
= {0x700b,0xa82a};
pascal long GetComponentRefcon(Component aComponent)
= {0x7010,0xa82a};
pascal void SetComponentRefcon(Component aComponent, long theRefcon)
= {0x7011,0xa82a};
pascal short OpenComponentResFile(Component aComponent)
= {0x7015,0xa82a};
pascal OSErr CloseComponentResFile(short refnum)
= {0x7018,0xa82a};
/********************************************************
* Component Instance Management routines
********************************************************/
pascal Handle GetComponentInstanceStorage(ComponentInstance aComponentInstance)
= {0x700c,0xa82a};
pascal void SetComponentInstanceStorage(ComponentInstance aComponentInstance, Handle theStorage)
= {0x700d,0xa82a};
pascal long GetComponentInstanceA5(ComponentInstance aComponentInstance)
= {0x700e,0xa82a};
pascal void SetComponentInstanceA5(ComponentInstance aComponentInstance, long theA5)
= {0x700f,0xa82a};
pascal long CountComponentInstances(Component aComponent)
= {0x7013,0xa82a};
pascal ComponentInstance FindNextCommonComponentInstance(ComponentInstance ti, Component t, ComponentRoutine commonEntryPoint)
= {0x7014,0xa82a};
/* useful helper routines for convenient method dispatching */
pascal long CallComponentFunction(ComponentParameters *params, ComponentFunction ) = {0x70FF,0xA82A};
pascal long CallComponentFunctionWithStorage(Handle storage, ComponentParameters *params, ComponentFunction ) = {0x70FF,0xA82A};
pascal long DelegateComponentCall( ComponentParameters *originalParams, ComponentInstance ti ) = {0x7024,0xA82A};
enum { /* Set Default Component flags */
defaultComponentIdentical = 0,
defaultComponentAnyFlags = 1,
defaultComponentAnyManufacturer = 2,
defaultComponentAnySubType = 4
};
#define defaultComponentAnyFlagsAnyManufacturer defaultComponentAnyFlags+defaultComponentAnyManufacturer
#define defaultComponentAnyFlagsAnyManufacturerAnySubType defaultComponentAnyFlags+defaultComponentAnyManufacturer+defaultComponentAnySubType
pascal OSErr SetDefaultComponent( Component aComponent, short flags )
= {0x701e,0xa82a};
pascal ComponentInstance OpenDefaultComponent( long componentType, long componentSubType )
= {0x7021,0xa82a};
pascal Component CaptureComponent( Component capturedComponent, Component capturingComponent )
= {0x701c,0xa82a};
pascal OSErr UncaptureComponent( Component aComponent )
= {0x701d,0xa82a};
#endif _Components_